package edu.zut.cs.network.Experiment2;

import javax.swing.JOptionPane;

public class CylinderVolume {
    public static void main(String[] args){
        double area,volume;
        String a=JOptionPane.showInputDialog("请输入圆柱体的半径：");
        double radius = Double.parseDouble(a);
        String b=JOptionPane.showInputDialog("请输入圆柱体的长度：");
        double length = Double.parseDouble(b);

        double pi=Math.PI;
        area = radius * radius * pi;
        volume = area * length;
        JOptionPane.showMessageDialog(null, "该圆柱体的体积为："+volume,
                "圆柱体的体积", JOptionPane.INFORMATION_MESSAGE);
    }
}
